// 引入 request 方法
import request from '/@/utils/request';

// 定义 API 路径枚举
enum Api {
    DemoPages = '/api/Demo/Pages',
    DemoAdd = '/api/Demo/Add',
    DemoUpdate = '/api/Demo/Update',
    DemoDelete = '/api/Demo/Delete',
}

// 查询Demo列表（分页）
export const apiDemoPagePost = (params?: any) =>
    request({
        url: Api.DemoPages,
        method: 'get',
        params,
    });

// 新增Demo
export const apiDemoAddPost = (body: any) =>
    request({
        url: Api.DemoAdd,
        method: 'post',
        data: body,
    });

// 更新Demo
export const apiDemoUpdatePost = (body: any) =>
    request({
        url: Api.DemoUpdate,
        method: 'post',
        data: body,
    });

// 删除Demo
export const apiDemoDeletePost = (body: any) =>
    request({
        url: Api.DemoDelete,
        method: 'post',
        data: body,
    });
